include("shared.lua");
AddCSLuaFile("cl_init.lua");
AddCSLuaFile("shared.lua");
-- Setting up all the different properties of our melon.
ENT.Delay = 1.3;
ENT.Healthlol = 25;
ENT.FiringRange = 300;
ENT.NoMoveRange = 50;
ENT.MinRange = 0;
ENT.DeathRadius = 20;
ENT.DeathMagnitude = 2;
ENT.MovingForce = 30;
ENT.MelonModel = "models/props_junk/watermelon01.mdl";

-- Now we tell the base class to set up the melon. Pay attention - the variables must be defined BEFORE calling Setup().
function ENT:Initialize()
	self:Setup();
if !self.Grav then 
util.SpriteTrail(self.Entity, 0, Color(255, 255, 255), false, 10, 0, 2, 1/10*0.5, "trails/smoke.vmt")
self.MovingForce = (self.MovingForce * server_settings.Int( "WM_Flyingspeed", 0.75))
end
Sound ("Weapon_SMG1.Single");
end
--What to do when we've found a target, and we've got the goahead to start attacking
function ENT:Attack()
		local angle = self.Target:GetPos() - self.Entity:GetPos();
		self.Target:TakeDamage(3, self.Entity);
		local fx = EffectData();
		fx:SetOrigin(self.Entity:GetPos());
		fx:SetStart(self.Target:GetPos());
	if (self.Team == 1) then
		util.Effect("johnny_redlaser", fx);
	
	elseif (self.Team == 2) then
		util.Effect("johnny_bluelaser", fx);
	
	elseif (self.Team == 3) then
		util.Effect("johnny_greenlaser", fx);
	elseif (self.Team == 4) then
		util.Effect("johnny_yellowlaser", fx);
	elseif (self.Team == 5) then
		util.Effect("johnny_magentalaser", fx);
	elseif (self.Team == 6) then
		util.Effect("johnny_cyanlaser", fx);
	else
		util.Effect("johnny_redlaser", fx);
	end
		local fxx = EffectData();
		fxx:SetOrigin(self.Entity:GetPos());
		fxx:SetAngle(angle:Angle());
		fxx:SetScale(1.2);
		util.Effect("MuzzleEffect", fxx);
		self.Entity:EmitSound("Weapon_Mortar.Single", 100, 100);
end

--Any other code you want to tag on to the end of the think function.
function ENT:OtherThoughts()
end
